const vscode = require('vscode');
var exec = require('child_process').exec;
const path = require('path');
module.exports = function(context) {
    context.subscriptions.push(vscode.commands.registerCommand('extension.getCurrentFilePath', (uri) => {

        // vscode.window.showInformationMessage(`当前文件(夹)路径是：${uri ? uri.path : '空'}`);
        // exec('start "" "'+path.dirname(uri._fsPath)+'"'); //打开目录
        exec('explorer.exe /select,"'+uri._fsPath+'"') //打开资源管理器并选中文件
    }));

    context.subscriptions.push(vscode.commands.registerCommand('extension.getPackagePath', (uri) => {

        vscode.workspace.workspaceFolders.map(item => {
            if (uri._fsPath.indexOf(item.uri.fsPath) === 0) {
                exec('start "" "'+item.uri.fsPath+'"'); //打开目录
            }
        });
    }));
};